﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AMT.IdentityModel.OAuth.Tests
{
	internal class TestValueMangler
	{
		internal static string MangleSymmetricKey(string symmetricKey)
		{
			string retVal = symmetricKey;
			if (null != symmetricKey && string.Empty != symmetricKey)
			{
				StringBuilder b = new StringBuilder(symmetricKey);
				// Determine a mangle value (anything diff from first char in key)
				char mangle = 'A';
				while (symmetricKey[0].Equals(mangle))
				{
					++mangle;
				}
				// MangleSymmetricKey the key by changing the first char
				b[0] = mangle;
				retVal = b.ToString();
			}

			return retVal;
		}
	}
}
